package cn.sgjk.train.business.controller;


import cn.sgjk.train.business.req.DailyTrainTicketQueryReq;
import cn.sgjk.train.business.req.DailyTrainTicketSaveReq;
import cn.sgjk.train.business.resp.DailyTrainTicketQueryResp;
import cn.sgjk.train.business.service.DailyTrainTicketService;
import cn.sgjk.train.common.resp.CommonResp;
import cn.sgjk.train.common.resp.PageResp;
import jakarta.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/daily-train-ticket")
public class TicketController {

    private static final Logger LOG = LoggerFactory.getLogger(TicketController.class);
    @Autowired
    private DailyTrainTicketService dailyTrainTicketService;




    @GetMapping("/query-list")
    public CommonResp<PageResp<DailyTrainTicketQueryResp>> query(@Valid DailyTrainTicketQueryReq dailyTrainTicketQueryReq) {
        PageResp<DailyTrainTicketQueryResp> dailyTrainTicketQueryResps = dailyTrainTicketService.queryList(dailyTrainTicketQueryReq);
        return new CommonResp<>(dailyTrainTicketQueryResps);
    }

}

